<template>
	<div class="loginQR">
		<div id="wx_qrcode"></div>
	</div>
</template>

<script>
import { Base64 } from 'js-base64';
export default {
	data() {
		return {};
	},
	mounted() {
		// agent/oauth/callback
		//  /agent/oauth/commonCallback
		let url = encodeURIComponent('http://dv.care-bay.com/#/isadmin');
		this.$nextTick(() => {
			window.WwLogin({
				id: 'wx_qrcode',
				appid: 'wwf68204ae4a46cf84',
				agentid: '1000035',
				redirect_uri: encodeURIComponent('http://japi.care-bay.com/dashboard/agent/oauth/commonCallback?target=' + url + '&agentId=4'),
				href: `data:text/css;base64,${Base64.encode(`.impowerBox .qrcode {width: 200px;}`)}`
			});
		});
	},
	computed: {},
	methods: {},
	watch: {}
};
</script>

<style lang="less" scoped>
.loginQR {
	position: relative;
	width: 100%;
	min-height: 100vh;
	background-color: #324057;
}
#wx_qrcode {
	padding: 20px;
	background-color: white;
	border-radius: 10px;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}
</style>
